Optimal. Leaf size=93 \[ -\frac {\log \left (a \cos ^2(e+f x)+b \sin ^2(e+f x)\right )}{2 (a-b)^3 f}+\frac {1}{4 (a-b) f \left (a+b \tan ^2(e+f x)\right )^2}+\frac {1}{2 (a-b)^2 f \left (a+b \tan ^2(e+f x)\right )} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.06, antiderivative size = 93, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 3, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {3751, 455, 46}
\begin {gather*} \frac {1}{2 f (a-b)^2 \left (a+b \tan ^2(e+f x)\right )}+\frac {1}{4 f (a-b) \left (a+b \tan ^2(e+f x)\right )^2}-\frac {\log \left (a \cos ^2(e+f x)+b \sin ^2(e+f x)\right )}{2 f (a-b)^3} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 46
Rule 455
Rule 3751
Rubi steps
\begin {align*} \int \frac {\tan (e+f x)}{\left (a+b \tan ^2(e+f x)\right )^3} \, dx &=\frac {\text {Subst}\left (\int \frac {x}{\left (1+x^2\right ) \left (a+b x^2\right )^3} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {\text {Subst}\left (\int \frac {1}{(1+x) (a+b x)^3} \, dx,x,\tan ^2(e+f x)\right )}{2 f}\\ &=\frac {\text {Subst}\left (\int \left (\frac {1}{(a-b)^3 (1+x)}-\frac {b}{(a-b) (a+b x)^3}-\frac {b}{(a-b)^2 (a+b x)^2}+\frac {b}{(-a+b)^3 (a+b x)}\right ) \, dx,x,\tan ^2(e+f x)\right )}{2 f}\\ &=-\frac {\log \left (a \cos ^2(e+f x)+b \sin ^2(e+f x)\right )}{2 (a-b)^3 f}+\frac {1}{4 (a-b) f \left (a+b \tan ^2(e+f x)\right )^2}+\frac {1}{2 (a-b)^2 f \left (a+b \tan ^2(e+f x)\right )}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.51, size = 82, normalized size = 0.88 \begin {gather*} \frac {-4 \log (\cos (e+f x))-2 \log \left (a+b \tan ^2(e+f x)\right )+\frac {(a-b)^2}{\left (a+b \tan ^2(e+f x)\right )^2}+\frac {2 (a-b)}{a+b \tan ^2(e+f x)}}{4 (a-b)^3 f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.17, size = 108, normalized size = 1.16
method | result | size |
derivativedivides | \(\frac {\frac {\ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{2 \left (a -b \right )^{3}}-\frac {b \left (\frac {\ln \left (a +b \left (\tan ^{2}\left (f x +e \right )\right )\right )}{b}-\frac {a -b}{b \left (a +b \left (\tan ^{2}\left (f x +e \right )\right )\right )}-\frac {a^{2}-2 a b +b^{2}}{2 b \left (a +b \left (\tan ^{2}\left (f x +e \right )\right )\right )^{2}}\right )}{2 \left (a -b \right )^{3}}}{f}\) | \(108\) |
default | \(\frac {\frac {\ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{2 \left (a -b \right )^{3}}-\frac {b \left (\frac {\ln \left (a +b \left (\tan ^{2}\left (f x +e \right )\right )\right )}{b}-\frac {a -b}{b \left (a +b \left (\tan ^{2}\left (f x +e \right )\right )\right )}-\frac {a^{2}-2 a b +b^{2}}{2 b \left (a +b \left (\tan ^{2}\left (f x +e \right )\right )\right )^{2}}\right )}{2 \left (a -b \right )^{3}}}{f}\) | \(108\) |
norman | \(\frac {\frac {3 a \,b^{2}-b^{3}}{4 b^{2} \left (a^{2}-2 a b +b^{2}\right ) f}+\frac {b \left (\tan ^{2}\left (f x +e \right )\right )}{2 \left (a^{2}-2 a b +b^{2}\right ) f}}{\left (a +b \left (\tan ^{2}\left (f x +e \right )\right )\right )^{2}}+\frac {\ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{2 f \left (a^{3}-3 a^{2} b +3 a \,b^{2}-b^{3}\right )}-\frac {\ln \left (a +b \left (\tan ^{2}\left (f x +e \right )\right )\right )}{2 f \left (a^{3}-3 a^{2} b +3 a \,b^{2}-b^{3}\right )}\) | \(158\) |
risch | \(\frac {i x}{a^{3}-3 a^{2} b +3 a \,b^{2}-b^{3}}+\frac {2 i e}{f \left (a^{3}-3 a^{2} b +3 a \,b^{2}-b^{3}\right )}-\frac {4 b \left (-a \,{\mathrm e}^{6 i \left (f x +e \right )}+b \,{\mathrm e}^{6 i \left (f x +e \right )}-2 a \,{\mathrm e}^{4 i \left (f x +e \right )}-b \,{\mathrm e}^{4 i \left (f x +e \right )}-a \,{\mathrm e}^{2 i \left (f x +e \right )}+b \,{\mathrm e}^{2 i \left (f x +e \right )}\right )}{\left (-a \,{\mathrm e}^{4 i \left (f x +e \right )}+b \,{\mathrm e}^{4 i \left (f x +e \right )}-2 a \,{\mathrm e}^{2 i \left (f x +e \right )}-2 b \,{\mathrm e}^{2 i \left (f x +e \right )}-a +b \right )^{2} f \left (-a +b \right )^{3}}-\frac {\ln \left ({\mathrm e}^{4 i \left (f x +e \right )}+\frac {2 \left (a +b \right ) {\mathrm e}^{2 i \left (f x +e \right )}}{a -b}+1\right )}{2 f \left (a^{3}-3 a^{2} b +3 a \,b^{2}-b^{3}\right )}\) | \(258\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 196 vs.
\(2 (91) = 182\).
time = 0.29, size = 196, normalized size = 2.11 \begin {gather*} \frac {\frac {4 \, {\left (a b - b^{2}\right )} \sin \left (f x + e\right )^{2} - 4 \, a b + b^{2}}{a^{5} - 3 \, a^{4} b + 3 \, a^{3} b^{2} - a^{2} b^{3} + {\left (a^{5} - 5 \, a^{4} b + 10 \, a^{3} b^{2} - 10 \, a^{2} b^{3} + 5 \, a b^{4} - b^{5}\right )} \sin \left (f x + e\right )^{4} - 2 \, {\left (a^{5} - 4 \, a^{4} b + 6 \, a^{3} b^{2} - 4 \, a^{2} b^{3} + a b^{4}\right )} \sin \left (f x + e\right )^{2}} - \frac {2 \, \log \left (-{\left (a - b\right )} \sin \left (f x + e\right )^{2} + a\right )}{a^{3} - 3 \, a^{2} b + 3 \, a b^{2} - b^{3}}}{4 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 214 vs.
\(2 (91) = 182\).
time = 1.69, size = 214, normalized size = 2.30 \begin {gather*} -\frac {3 \, b^{2} \tan \left (f x + e\right )^{4} + 2 \, {\left (2 \, a b + b^{2}\right )} \tan \left (f x + e\right )^{2} + 4 \, a b - b^{2} + 2 \, {\left (b^{2} \tan \left (f x + e\right )^{4} + 2 \, a b \tan \left (f x + e\right )^{2} + a^{2}\right )} \log \left (\frac {b \tan \left (f x + e\right )^{2} + a}{\tan \left (f x + e\right )^{2} + 1}\right )}{4 \, {\left ({\left (a^{3} b^{2} - 3 \, a^{2} b^{3} + 3 \, a b^{4} - b^{5}\right )} f \tan \left (f x + e\right )^{4} + 2 \, {\left (a^{4} b - 3 \, a^{3} b^{2} + 3 \, a^{2} b^{3} - a b^{4}\right )} f \tan \left (f x + e\right )^{2} + {\left (a^{5} - 3 \, a^{4} b + 3 \, a^{3} b^{2} - a^{2} b^{3}\right )} f\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 2846 vs.
\(2 (73) = 146\).
time = 75.06, size = 2846, normalized size = 30.60 \begin {gather*} \text {Too large to display} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 650 vs.
\(2 (91) = 182\).
time = 1.05, size = 650, normalized size = 6.99 \begin {gather*} -\frac {\frac {2 \, \log \left (a + \frac {2 \, a {\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} - \frac {4 \, b {\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} + \frac {a {\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}}\right )}{a^{3} - 3 \, a^{2} b + 3 \, a b^{2} - b^{3}} - \frac {4 \, \log \left ({\left | -\frac {\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1} + 1 \right |}\right )}{a^{3} - 3 \, a^{2} b + 3 \, a b^{2} - b^{3}} - \frac {3 \, a^{4} + \frac {12 \, a^{4} {\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} - \frac {8 \, a^{3} b {\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} - \frac {24 \, a^{2} b^{2} {\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} + \frac {8 \, a b^{3} {\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} + \frac {18 \, a^{4} {\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} - \frac {16 \, a^{3} b {\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} - \frac {48 \, a^{2} b^{2} {\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} + \frac {80 \, a b^{3} {\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} - \frac {16 \, b^{4} {\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} + \frac {12 \, a^{4} {\left (\cos \left (f x + e\right ) - 1\right )}^{3}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{3}} - \frac {8 \, a^{3} b {\left (\cos \left (f x + e\right ) - 1\right )}^{3}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{3}} - \frac {24 \, a^{2} b^{2} {\left (\cos \left (f x + e\right ) - 1\right )}^{3}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{3}} + \frac {8 \, a b^{3} {\left (\cos \left (f x + e\right ) - 1\right )}^{3}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{3}} + \frac {3 \, a^{4} {\left (\cos \left (f x + e\right ) - 1\right )}^{4}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{4}}}{{\left (a^{5} - 3 \, a^{4} b + 3 \, a^{3} b^{2} - a^{2} b^{3}\right )} {\left (a + \frac {2 \, a {\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} - \frac {4 \, b {\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} + \frac {a {\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}}\right )}^{2}}}{4 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 12.46, size = 375, normalized size = 4.03 \begin {gather*} \frac {a^2\,\left (-3+\mathrm {atan}\left (\frac {a\,{\mathrm {tan}\left (e+f\,x\right )}^2\,1{}\mathrm {i}-b\,{\mathrm {tan}\left (e+f\,x\right )}^2\,1{}\mathrm {i}}{2\,a+a\,{\mathrm {tan}\left (e+f\,x\right )}^2+b\,{\mathrm {tan}\left (e+f\,x\right )}^2}\right )\,4{}\mathrm {i}\right )+b^2\,\left (2\,{\mathrm {tan}\left (e+f\,x\right )}^2-1+{\mathrm {tan}\left (e+f\,x\right )}^4\,\mathrm {atan}\left (\frac {a\,{\mathrm {tan}\left (e+f\,x\right )}^2\,1{}\mathrm {i}-b\,{\mathrm {tan}\left (e+f\,x\right )}^2\,1{}\mathrm {i}}{2\,a+a\,{\mathrm {tan}\left (e+f\,x\right )}^2+b\,{\mathrm {tan}\left (e+f\,x\right )}^2}\right )\,4{}\mathrm {i}\right )+a\,b\,\left (4-2\,{\mathrm {tan}\left (e+f\,x\right )}^2+{\mathrm {tan}\left (e+f\,x\right )}^2\,\mathrm {atan}\left (\frac {a\,{\mathrm {tan}\left (e+f\,x\right )}^2\,1{}\mathrm {i}-b\,{\mathrm {tan}\left (e+f\,x\right )}^2\,1{}\mathrm {i}}{2\,a+a\,{\mathrm {tan}\left (e+f\,x\right )}^2+b\,{\mathrm {tan}\left (e+f\,x\right )}^2}\right )\,8{}\mathrm {i}\right )}{f\,\left (-4\,a^5-8\,a^4\,b\,{\mathrm {tan}\left (e+f\,x\right )}^2+12\,a^4\,b-4\,a^3\,b^2\,{\mathrm {tan}\left (e+f\,x\right )}^4+24\,a^3\,b^2\,{\mathrm {tan}\left (e+f\,x\right )}^2-12\,a^3\,b^2+12\,a^2\,b^3\,{\mathrm {tan}\left (e+f\,x\right )}^4-24\,a^2\,b^3\,{\mathrm {tan}\left (e+f\,x\right )}^2+4\,a^2\,b^3-12\,a\,b^4\,{\mathrm {tan}\left (e+f\,x\right )}^4+8\,a\,b^4\,{\mathrm {tan}\left (e+f\,x\right )}^2+4\,b^5\,{\mathrm {tan}\left (e+f\,x\right )}^4\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________